package com.cskaoyan.service.impl;

import com.cskaoyan.bean.bo.*;
import com.cskaoyan.mapper.MarketOrderGoodsMapper;
import com.cskaoyan.mapper.MarketOrderMapper;
import com.cskaoyan.mapper.MarketUserMapper;
import com.cskaoyan.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Tang_XueCheng
 * @description
 * @since 2022/04/06 22:12
 */
@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    MarketUserMapper marketUserMapper;
    @Autowired
    MarketOrderMapper marketOrderMapper;
    @Autowired
    MarketOrderGoodsMapper marketOrderGoodsMapper;

    @Override
    public AccountUserBO queryUser() {


        List<InnerRowOfAccountBO> innerRowOfAccountBOS = marketUserMapper.selectUserGroupByAddtime();


        AccountUserBO accountUserBO = new AccountUserBO();
        accountUserBO.setRows(innerRowOfAccountBOS);
        return accountUserBO;
    }

    @Override
    public AccountOrderBO queryOrder() {

        List<InnerOfAccountOrderBO> innerOfAccountOrderBOS = marketOrderMapper.selectInnerOfAccountOrderBOS();

        AccountOrderBO accountOrderBO = new AccountOrderBO();

        accountOrderBO.setRows(innerOfAccountOrderBOS);

        return accountOrderBO;
    }

    @Override
    public AccountGoodsBO queryGoods() {

        List<InnnerOfAccountGoodsBO> rows = marketOrderGoodsMapper.selectInnnerOfAccountGoodsBO();

        AccountGoodsBO accountGoodsBO = new AccountGoodsBO();
        accountGoodsBO.setRows(rows);

        return accountGoodsBO;
    }


}
